var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});
//Goods组件数据
router.get('/api/goods', function (req, res, next) {
  res.send(
    {
      code: 0,
      data: [
        {
          id: 1,
          name: "甜美各式小夹子刘海小发卡",
          actor: "../../../public/s-1.webp",
          actorname: "小甜心",
          actortag: "爆单女王",
          price: "199",
          sales: 500,
          imgUrl: "../../../public/s-1.webp",
          leftUrl: "../../../public/zhibotongjia.png",
          rightUrl: "../../../public/zhibo.png",
          byUrl: "../../../public/baoyou.png",
        },
        {
          id: 2,
          name: "甜美各式小夹子刘海小发卡",
          actor: "../../../public/s-2.webp",
          actorname: "小甜心",
          actortag: "爆单女王",
          price: "199",
          sales: 500,
          imgUrl: "../../../public/s-2.webp",
          leftUrl: "../../../public/zhibotongjia.png",
          rightUrl: "../../../public/zhibo.png",
          byUrl: "../../../public/baoyou.png",
        },
        {
          id: 3,
          name: "甜美各式小夹子刘海小发卡",
          actor: "../../../public/s-3.webp",
          actorname: "小甜心",
          actortag: "爆单女王",
          price: "199",
          sales: 300,
          imgUrl: "../../../public/s-3.webp",
          leftUrl: "../../../public/zhibotongjia.png",
          rightUrl: "../../../public/zhibo.png",
          byUrl: "../../../public/baoyou.png",
        },
        {
          id: 4,
          name: "甜美各式小夹子刘海小发卡",
          actor: "../../../public/s-4.webp",
          actorname: "小甜心",
          actortag: "爆单女王",
          price: "199",
          sales: 900,
          imgUrl: "../../../public/s-4.webp",
          leftUrl: "../../../public/zhibotongjia.png",
          rightUrl: "../../../public/zhibo.png",
          byUrl: "../../../public/baoyou.png",
        },
        {
          id: 5,
          name: "甜美各式小夹子刘海小发卡",
          actor: "../../../public/s-5.webp",
          actorname: "小甜心",
          actortag: "爆单女王",
          price: "199",
          sales: 300,
          imgUrl: "../../../public/s-5.webp",
          leftUrl: "../../../public/zhibotongjia.png",
          rightUrl: "../../../public/zhibo.png",
          byUrl: "../../../public/baoyou.png",
        },
        {
          id: 6,
          name: "甜美各式小夹子刘海小发卡",
          actor: "../../../public/s-6.webp",
          actorname: "小甜心",
          actortag: "爆单女王",
          price: "199",
          sales: 200,
          imgUrl: "../../../public/s-6.webp",
          leftUrl: "../../../public/zhibotongjia.png",
          rightUrl: "../../../public/zhibo.png",
          byUrl: "../../../public/baoyou.png",
        }
      ]
    }
  )
});
// Sort组件数据
router.get('/api/sorts', function (req, res, next) {
  res.send({
    code: 0,
    data: [
      {
        id: 1,
        title: "女装",
        imgUrl: "../../../public/1.webp",
      },
      {
        id: 2,
        title: "女鞋",
        imgUrl: "../../../public/2.webp",
      },
      {
        id: 3,
        title: "上衣",
        imgUrl: "../../../public/3.webp",
      },
      {
        id: 4,
        title: "美妆/护肤",
        imgUrl: "../../../public/4.webp",
      },
      {
        id: 5,
        title: "裤子",
        imgUrl: "../../../public/5.webp",
      },
      {
        id: 6,
        title: "母婴/童装",
        imgUrl: "../../../public/6.webp",
      },
      {
        id: 7,
        title: "裙子",
        imgUrl: "../../../public/7.webp",
      },
      {
        id: 8,
        title: "男装男鞋",
        imgUrl: "../../../public/8.webp",
      },
      {
        id: 9,
        title: "套装",
        imgUrl: "../../../public/9.webp",
      },
      {
        id: 10,
        title: "配饰",
        imgUrl: "../../../public/10.webp",
      }
    ]
  })
});
//搜索窗口初始数据
router.get('/api/searchIndex', function (req,res, next) {
  res.send({
    code: 0,
    data: [
      {
        id: 1,
        imgSrc: '../../../public/list-1.webp',
        title: '新款款宽松上衣外装谢谢谢谢谢谢',
        spanPrice: 119,
        hot:234
      },
      {
        id: 2,
        imgSrc: '../../../public/list-2.webp',
        title: '新款款宽松上衣外装谢谢谢谢谢谢',
        spanPrice: 132,
        hot:334
      },
      {
        id: 3,
        imgSrc: '../../../public/list-3.webp',
        title: '新款款宽松上衣外装谢谢谢谢谢谢',
        spanPrice: 219,
        hot:134
      },
      {
        id:4,
        imgSrc: '../../../public/list-4.webp',
        title: '新款款宽松上衣外装谢谢谢谢谢谢',
        spanPrice: 319,
        hot:267
      }
    ]
  })
})
module.exports = router;
